#define LUA_LIB
  
#include "lprefix.h"

#ifdef _3DS
  #include <3ds.h> 
#endif
#include <stdio.h> 
  
#include "lua.h"
 
#include "lauxlib.h"
#include "lualib.h"

static int console_hello()
{
#ifdef _3DS
  printf("\x1b[15;19HHello LUA :)!");
#else
  printf("Hello World!\n");
#endif

  return 0;
}

static const luaL_Reg consolelib[] = {
  {"hello", console_hello},
  {NULL,  NULL},
};

LUAMOD_API int luaopen_console (lua_State *L) {
  luaL_newlib(L, consolelib);

  return 1;
} 

